<?php
namespace Modules\Admin\Services;

class AdminService {
  public function authorize($admin) {
    return [
      'code' => 0,
      'message' => '授权成功!',
      'token' => (new \Modules\Admin\Libraries\JWT()) -> setToken([
        'admin' => [
          'admin_id' => $admin -> admin_id
        ]
      ]),
      'data' => [
        'admin' => [
          'admin_name' => $admin -> admin_name,
        ]
      ]
    ];
  }
}
?>